package com.fh.service.system.userrole;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.fh.dao.DaoSupport;
import com.fh.util.PageData;

@Service("userRoleService")
public class UserRoleService {

	@Resource(name = "daoSupport")
	private DaoSupport dao;

	/**
	 * 
	 * TODO 方法作用：给用户生成角色关系
	 * 
	 * @param pd
	 * @throws Exception
	 * @Author: 孙超文
	 * @Date: 2015-9-9 下午8:51:03
	 */
	public void saveUR(PageData pd) throws Exception {
		dao.save("UserRoleMapper.insert", pd);
	}

	/*
	 * 删除用户
	 */
	public void deleteUR(PageData pd) throws Exception {
		dao.delete("UserRoleMapper.delete", pd);
	}

	public List<PageData> URlistAll(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("UserRoleMapper.URlistall", pd);
	}

}
